Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Latest commit

 

History

History
35 lines (28 loc) · 757 Bytes

3.8.9 - Coroutine/MySQL/Statement->nextResult.md

File metadata and controls

35 lines (28 loc) · 757 Bytes

Coroutine\MySQL\Statement->nextResult

Ver >= 4.0-rc1

在一个多响应结果语句句柄中推进到下一个响应结果 (如存储过程的多结果返回)

function Coroutine\MySQL->nextResult() : ?bool

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE,无下一结果时返回NULL。

示例

非fetch模式

$stmt = $db->prepare('CALL reply(?)');
$res = $stmt->execute(['hello mysql!']);
do {
	var_dump($res);
} while ($res = $stmt->nextResult());
var_dump($stmt->affected_rows);

fetch模式

$stmt = $db->prepare('CALL reply(?)');
$stmt->execute(['hello mysql!']);
do {
	$res = $stmt->fetchAll();
	var_dump($res);
} while ($stmt->nextResult());
var_dump($stmt->affected_rows);